﻿using Microsoft.AspNetCore.Http.Features;
using Microsoft.Data.SqlClient;
using Microsoft.Data.SqlClient.Server;

using System.Data;
using System.Data.Common;
using System.Diagnostics;
using System.Security.Claims;

using WXWorkSvc.Common.Data;

namespace OpenPms.Pages;

public class IndexModel : PageModel
{
    private readonly ILogger<IndexModel> logger;
    private readonly WXDbContext db;
    private readonly AppDbContext appDbContext;
    private readonly OrderService orderService;
    public IndexModel(ILogger<IndexModel> logger, WXDbContext db, OrderService orderService, AppDbContext appdb)
    {
        this.logger = logger;
        this.db = db;
        this.orderService = orderService;
        this.appDbContext = appdb;
    }
    public async Task<IActionResult> OnGet([FromServices] IOss oss)
    {
        await Task.Delay(1);
        if (Request.Headers["User-Agent"].ToString().ToLower().Contains("mobile"))
            return RedirectToPage(new { area = "M" });
        else
            //return Page();
            return RedirectToPage("/index", new { area = "d" });
    }
}
